package org.gourpg.model.user;

import java.sql.Timestamp;

/**
 * 登录用户配置实体
 */
public class UserDetails {
    /**
     * 纯ID，新用户临时生成，person表主键
     */
    private Integer personId;

    /**
     * 登录用名字
     */
    private String loginCode;

    /**
     * 密码（密钥类型全系统统一）默认abc123
     */
    private String psw;

    /**
     * 更新时间戳
     */
    private Timestamp updateTime;

    /**
     * 错误次数
     */
    private Integer errorNumber;

    /**
     * 最近一次登录时间
     */
    private Timestamp lastLoginTime;

    /**
     * 是否已锁定(Y/N)
     */
    private String isLocked;

    /**
     * 是否已登录(Y/N)
     */
    private String isLogined;

    public UserDetails() {
    }

    public Integer getPersonId() {
        return this.personId;
    }

    public String getLoginCode() {
        return this.loginCode;
    }

    public String getPsw() {
        return this.psw;
    }

    public Timestamp getUpdateTime() {
        return this.updateTime;
    }

    public Integer getErrorNumber() {
        return this.errorNumber;
    }

    public Timestamp getLastLoginTime() {
        return this.lastLoginTime;
    }

    public String getIsLocked() {
        return this.isLocked;
    }

    public String getIsLogined() {
        return this.isLogined;
    }

    public void setPersonId(Integer personId) {
        this.personId = personId;
    }

    public void setLoginCode(String loginCode) {
        this.loginCode = loginCode;
    }

    public void setPsw(String psw) {
        this.psw = psw;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    public void setErrorNumber(Integer errorNumber) {
        this.errorNumber = errorNumber;
    }

    public void setLastLoginTime(Timestamp lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public void setIsLocked(String isLocked) {
        this.isLocked = isLocked;
    }

    public void setIsLogined(String isLogined) {
        this.isLogined = isLogined;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof UserDetails)) return false;
        final UserDetails other = (UserDetails) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$personId = this.getPersonId();
        final Object other$personId = other.getPersonId();
        if (this$personId == null ? other$personId != null : !this$personId.equals(other$personId)) return false;
        final Object this$loginCode = this.getLoginCode();
        final Object other$loginCode = other.getLoginCode();
        if (this$loginCode == null ? other$loginCode != null : !this$loginCode.equals(other$loginCode)) return false;
        final Object this$psw = this.getPsw();
        final Object other$psw = other.getPsw();
        if (this$psw == null ? other$psw != null : !this$psw.equals(other$psw)) return false;
        final Object this$updateTime = this.getUpdateTime();
        final Object other$updateTime = other.getUpdateTime();
        if (this$updateTime == null ? other$updateTime != null : !this$updateTime.equals(other$updateTime))
            return false;
        final Object this$errorNumber = this.getErrorNumber();
        final Object other$errorNumber = other.getErrorNumber();
        if (this$errorNumber == null ? other$errorNumber != null : !this$errorNumber.equals(other$errorNumber))
            return false;
        final Object this$lastLoginTime = this.getLastLoginTime();
        final Object other$lastLoginTime = other.getLastLoginTime();
        if (this$lastLoginTime == null ? other$lastLoginTime != null : !this$lastLoginTime.equals(other$lastLoginTime))
            return false;
        final Object this$isLocked = this.getIsLocked();
        final Object other$isLocked = other.getIsLocked();
        if (this$isLocked == null ? other$isLocked != null : !this$isLocked.equals(other$isLocked)) return false;
        final Object this$isLogined = this.getIsLogined();
        final Object other$isLogined = other.getIsLogined();
        if (this$isLogined == null ? other$isLogined != null : !this$isLogined.equals(other$isLogined)) return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof UserDetails;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $personId = this.getPersonId();
        result = result * PRIME + ($personId == null ? 43 : $personId.hashCode());
        final Object $loginCode = this.getLoginCode();
        result = result * PRIME + ($loginCode == null ? 43 : $loginCode.hashCode());
        final Object $psw = this.getPsw();
        result = result * PRIME + ($psw == null ? 43 : $psw.hashCode());
        final Object $updateTime = this.getUpdateTime();
        result = result * PRIME + ($updateTime == null ? 43 : $updateTime.hashCode());
        final Object $errorNumber = this.getErrorNumber();
        result = result * PRIME + ($errorNumber == null ? 43 : $errorNumber.hashCode());
        final Object $lastLoginTime = this.getLastLoginTime();
        result = result * PRIME + ($lastLoginTime == null ? 43 : $lastLoginTime.hashCode());
        final Object $isLocked = this.getIsLocked();
        result = result * PRIME + ($isLocked == null ? 43 : $isLocked.hashCode());
        final Object $isLogined = this.getIsLogined();
        result = result * PRIME + ($isLogined == null ? 43 : $isLogined.hashCode());
        return result;
    }

    public String toString() {
        return "UserDetails(personId=" + this.getPersonId() + ", loginCode=" + this.getLoginCode() + ", psw=" + this.getPsw() + ", updateTime=" + this.getUpdateTime() + ", errorNumber=" + this.getErrorNumber() + ", lastLoginTime=" + this.getLastLoginTime() + ", isLocked=" + this.getIsLocked() + ", isLogined=" + this.getIsLogined() + ")";
    }
}
